package cn.mill.spring;

import org.springframework.beans.factory.FactoryBean;

import cn.mill.core.Mill;

public class MillProxyFactoryBean<T> implements FactoryBean<T> {
	
	private Class<T> handler;
	
	public MillProxyFactoryBean(Class<T> handler) {
		this.handler = handler;
	}
	
	@Override
	public T getObject() throws Exception {
		return Mill.factory(handler);
	}
	
	@Override
	public Class<?> getObjectType() {
		return handler;
	}
	
	@Override
	public boolean isSingleton() {
		return false;
	}
	
}
